package com.boil.qz.safekavass.pojo;

/**
 * Created by ChenYong on 2017-08-21.
 * <br>
 * 角色资源关联映射实体类。
 */
public class RoleResourceVo {
    /**
     * 角色 ID
     */
    private Long roleId;
    /**
     * 资源 ID
     */
    private Long resourceId;
    /**
     * 角色代码
     */
    private String roleCode;
    /**
     * 角色名称
     */
    private String roleName;
    /**
     * 资源名称
     */
    private String resourceName;
    /**
     * 资源 URL
     */
    private String resourceUrl;
    /**
     * 权限代码
     */
    private String permissionCode;

    /**
     * 默认构造器。
     */
    public RoleResourceVo() {
        super();
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getResourceId() {
        return resourceId;
    }

    public void setResourceId(Long resourceId) {
        this.resourceId = resourceId;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RoleResourceVo that = (RoleResourceVo) o;

        if (roleId != null ? !roleId.equals(that.roleId) : that.roleId != null) return false;
        return resourceId != null ? resourceId.equals(that.resourceId) : that.resourceId == null;
    }

    @Override
    public int hashCode() {
        int result = roleId != null ? roleId.hashCode() : 0;
        result = 31 * result + (resourceId != null ? resourceId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("RoleResourceVo{");
        sb.append("roleId=").append(roleId);
        sb.append(", resourceId=").append(resourceId);
        sb.append(", roleCode='").append(roleCode).append('\'');
        sb.append(", roleName='").append(roleName).append('\'');
        sb.append(", resourceName='").append(resourceName).append('\'');
        sb.append(", resourceUrl='").append(resourceUrl).append('\'');
        sb.append(", permissionCode='").append(permissionCode).append('\'');
        sb.append('}');
        return sb.toString();
    }
}